﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WebshopPizzaRio.App_Code.DAL;
using WebshopPizzaRio.App_Code.DAL.NieuwsbriefsubsTableAdapters;
using WebshopPizzaRio.App_Code.DAL.DataSet1TableAdapters;

namespace WebshopPizzaRio
{
    public class NieuwsbriefBLL
    {
        private nieuwsbriefsubsTableAdapter nieuwsbrief = new nieuwsbriefsubsTableAdapter();

        public void insertNieuwsBriefToevoegen(String naam, String email)
        {
            nieuwsbrief.InsertNieuwsBriefToevoegen(naam, email);
        }

        public int getID() 
        {
                if (nieuwsbrief.GetDataByID() == null)
                {
                    return 1;
                }
                else
                {
                    int id = int.Parse(nieuwsbrief.GetDataByID().ToString());
                    return id + 1;
                }
            }

         public WebshopPizzaRio.App_Code.DAL.Nieuwsbriefsubs.nieuwsbriefsubsDataTable getEmails() 
            {
                return nieuwsbrief.GetDataByEmails();
            }
      }
}
